#!/bin/sh
# $Id: $
# This file is intended for developers only and is not included into dist
# Please RUN this AFTER cvs checkout/update
# This will re-create all needed stuff
# (aclocal.m4, config.h.in, Makefile.in, configure)
# or you may end up with old versions of that.
#

# libtoolize
LIBTOOLIZE=libtoolize
SYSNAME=`uname`
if [ "x$SYSNAME" = "xDarwin" ] ; then
	LIBTOOLIZE=glibtoolize
fi

# clean
if test "x-$1" = "x---clean" ; then
	echo "Cleaning ..."
	if test -f Makefile ; then
	  make clean
    fi
	find . -name Makefile -exec rm -f {} \;
	find . -name Makefile.in -exec rm -f {} \;
	rm -f aclocal.m4 config.* configure depcomp install-sh missing stamp-h1
	rm -rf ltmain.sh libtool autom4te.cache
	rm -f README INSTALL libscws/version.h
	echo "OK, done!"
	exit
fi

# init
ln -sf README.md README
for cmd in aclocal autoheader \
		"$LIBTOOLIZE --copy --force" \
		"automake --add-missing --copy --force" autoconf ; do
	echo "Running command: $cmd ..."
	$cmd 2>&1 | grep -i -v warning
done
echo
echo "--==*** You can run ./configure now ***==--";
echo -n "               Happy hacking";
if test -n $USER; then
	echo -n ", $USER";
fi
echo !
echo

